import java.util.HashMap;
import java.util.Map;

class CopilotTest {
    public static int findMode(int[] nums) {
        Map<Integer, Integer> countMap = new HashMap<>();
        int maxCount = 0;
        int mode = 0;

        for (int num : nums) {
            int count = countMap.getOrDefault(num, 0) + 1;
            countMap.put(num, count);

            if (count > maxCount) {
                maxCount = count;
                mode = num;
            }
        }

        return mode;
    }

    public static boolean isArmstrongNumber(int num) {
        int originalNum = num;
        int sum = 0;

        while (num > 0) {
            int digit = num % 10;
            sum += Math.pow(digit, 3);
            num /= 10;
        }

        return sum == originalNum;
    }

    public static int generateRandomNumber(int min, int max) {
        Random random = new Random();
        return random.nextInt(max - min + 1) + min;
    }

    public static int generateRandomNumbe(int min, int max) {
        Random random = new Random();
        return random.nextInt(max - min + 1) + min;
    }
}